From b27e4016aeaf9fce8cebd18e63c32120d3140bb9 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 25 Jul 2007 00:54:25 +0000 Subject: [PATCH] (webjump-url-encode): Fix for non-ASCII characters. --- lisp/net/webjump.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el index 03ce6305196..0b04c8f2f40 100644 --- a/lisp/net/webjump.el +++ b/lisp/net/webjump.el @@ -451,14 +451,12 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke (defun webjump-url-encode (str) (mapconcat '(lambda (c) - (cond ((= c 32) "+") - ((or (and (>= c ?a) (<= c ?z)) - (and (>= c ?A) (<= c ?Z)) - (and (>= c ?0) (<= c ?9))) - (char-to-string c)) - (t (upcase (format "%%%02x" c))))) - str - "")) + (let ((s (char-to-string c))) + (cond ((string= s " ") "+") + ((string-match "[a-zA-Z_.-/]" s) s) + (t (upcase (format "%%%02x" c)))))) + (encode-coding-string str 'utf-8) + "")) (defun webjump-url-fix (url) (if (webjump-null-or-blank-string-p url) -- 2.30.2